package main

import (
	"fmt"
	"strings"
)

func main() {
	fmt.Println(reverseMessage(" a good   example "))
}

func reverseMessage(message string) string {
	res := []string{}
	strList := strings.Split(message, " ")
	for i := len(strList) - 1; i >= 0; i-- {
		if len(strList[i]) > 0 {
			res = append(res, strList[i])
		}
	}
	return strings.Join(res, " ")
}
